﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="main4.aspx.cs" Inherits="main4" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>全厂首页3</title>
    <style type="text/css">
        .title
        {
            font-family: "仿宋";
            font-size: 23px;
        }
        .ht
        {
            height: 30px;
        }
        .th
        {
            font-size: 14px;
            height: 30px;
            width: 5%;
        }
        table tr td
        {
            text-align: center;
        }
        .ss
        {
            font-size: 18px;
            height: 30px;
        }
    </style>
    <link href="CSS/SIS.CSS" type="text/css" rel="Stylesheet" />

    <script type='text/javascript' src='js/jquery/jquery-1.7.1.min.js'></script>

    <script type="text/javascript" src="js/highcharts.js"></script>

    <script type="text/javascript" src="js/modules/exporting.js"></script>

    <script type="text/javascript">
        var chart;
        var dataJson;
        $(document).ready(function () {
           initChart();
           DL();
           window.setInterval(DL,10000);   
           window.setInterval(initChart,30000);   
        });
        function DL(){                 
            $.post("main3.aspx", { param: 'query' }, function (data) {              
                    var result = data.tableInfo;
                    var arr=result.split(',');
                    $("#lbl1").html(arr[0]);
                    $("#lbl2").html(arr[1]);
                    $("#qc").html(arr[2]);                
                  
                }, 'json');
        
        }           
        var initChart = function () {
           var dataJson;
              var ss;
             $.ajax({
                url: "WebService/WebService.asmx/GetFHByTimeByFourMin",
                contentType: "application/json; charset=utf-8",
                type: "POST",
                dataType: "json",
                data: "{'timeStr':'121'}",
                beforeSend: function () {
                   //Handle the beforeSend event
                },
                success: function (json) {                   
                    dataJson = $.parseJSON(json.d);
                    SetChartData();
                    SetChartData1();
                },
                error: function (x, e) {
                    alert(x.responseText);
                },
                complete: function () {
                    //Handle the complete event
                }
             });                
             
            var SetChartData = function () {
                var chart = new Highcharts.Chart({
                    chart: {
                        renderTo: 'div0',
                        type: 'spline'
                    },
                    credits: {
                        enabled: false
                    },
                    title: {
                        text: '', //芜湖电厂生产监视图
                        style: {
                            fontFamily: '"微软雅黑"',
                            fontSize: '14pt'
                        }
                    },
                    subtitle: {
                        enable: false
                    },
                    xAxis: {
                        type: 'datetime',
                        //lineWidth:3,
                        dateTimeLabelFormats: {
                            day: '00:00'
                        },
                        maxZoom: 2 * 3600 * 1000,
                        showFirstLabel: true,
                        showLastLabel: true,
                         tickWidth: 0,
			            gridLineWidth: 1
                    },
                    yAxis: {
                        title: {
                            text: '负荷(MW)'                            
                        },
                        labels: {
                            formatter: function () {
                                return this.value;
                            }
                        }
                    },
                    legend: {
                        align: 'left',
                        verticalAlign: 'top',
                        y: 0,
                        x: 20,
                        floating: true,
                        borderWidth: 0
                    },
                    tooltip: {
                        crosshairs: {
                            width: 2,
                            color: 'red'
                        },
                        shared: true,
                        xDateFormat: '<b>时间：%H:%M:%S</b>'
                        //xDateFormat:'<b>时间：%Y-%m-%d %H:%M:%S</b>'
                    },
                    plotOptions: {
                        spline: {
                            marker: {
                                enabled: false,
                                radius: 4,
                                lineColor: '#666666',
                                lineWidth: 1
                            }
                        }
                    },
                    series: [{
                        name: '全厂昨日负荷',
                        lineWidth:0.1,
                        marker: {
                            symbol: 'circle'
                        },
                        color: 'Green',                          
                        data:dataJson.zr0,
                        pointStart: Date.UTC(2012, 3, 26),
                        pointInterval: 600 * 1000 // 5minute
                     },{
                       name: '全厂今日负荷',
                        lineWidth:0.1,
                        marker: {
                            symbol: 'circle'
                        },
                        color: 'red',                          
                        data:dataJson.jr0,
                        pointStart: Date.UTC(2012, 3, 26),
                        pointInterval: 600 * 1000 // 5minute
                     }],
                     exporting: {
                        enabled: false
                    }
                });
            };
            
             var SetChartData1 = function () {
                var chart = new Highcharts.Chart({
                    chart: {
                        renderTo: 'divs',
                        type: 'spline'
                    },
                    credits: {
                        enabled: false
                    },
                    title: {
                        text: '', //芜湖电厂生产监视图
                        style: {
                            fontFamily: '"微软雅黑"',
                            fontSize: '14pt'
                        }
                    },
                    subtitle: {
                        enable: false
                    },
                    xAxis: {
                        type: 'datetime',
                        dateTimeLabelFormats: {
                            day: '00:00'
                        },
                        maxZoom: 2 * 3600 * 1000,
                        showFirstLabel: true,
                        showLastLabel: true,
                         tickWidth: 0,
			            gridLineWidth: 1
                    },
                    yAxis: {
                        title: {
                            text: '负荷(MW)'                            
                        },
                        labels: {
                            formatter: function () {
                                return this.value;
                            }
                        }
                    },
                    legend: {
                        align: 'left',
                        verticalAlign: 'top',
                        y: 0,
                        x: 20,
                        floating: true,
                        borderWidth: 0
                    },
                    tooltip: {
                        crosshairs: {
                            width: 2,
                            color: 'red'
                        },
                        shared: true,
                        xDateFormat: '<b>时间：%H:%M:%S</b>'
                        //xDateFormat:'<b>时间：%Y-%m-%d %H:%M:%S</b>'
                    },
                    plotOptions: {
                        spline: {
                            marker: {
                                enabled: false,
                                radius: 4,
                                lineColor: '#666666',
                                lineWidth: 1
                            }
                        }
                    },
                    series: [{
                        name: '#1昨日负荷',
                         lineWidth:0.1,
                        marker: {
                            symbol: 'circle'
                        },
                        color: 'Green',
                        data: dataJson.zr1,
                        pointStart: Date.UTC(2012, 3, 26),
                        pointInterval: 600 * 1000 // 5minute
                     },{
                        name: '#2昨日负荷',
                         lineWidth:0.1,
                        marker: {
                            symbol: 'circle'
                        },
                        color: 'yellow',
                        data: dataJson.zr2,
                        pointStart: Date.UTC(2012, 3, 26),
                        pointInterval: 600 * 1000 // 5minute
                     },{
                        name: '#1今日负荷',
                         lineWidth:0.1,
                        marker: {
                            symbol: 'circle'
                        },
                        color: 'red',
                        data: dataJson.jr1,
                        pointStart: Date.UTC(2012, 3, 26),
                        pointInterval: 600 * 1000 // 5minute
                     },{
                        name: '#2今日负荷',
                         lineWidth:0.1,
                        marker: {
                            symbol: 'circle'
                        },
                        color: 'purple',
                        data: dataJson.jr2,
                        pointStart: Date.UTC(2012, 3, 26),
                        pointInterval: 600 * 1000 // 5minute
                     }],
                     exporting: {
                        enabled: false
                    }
                });
            };
        }
       
    </script>

</head>
<body style="background-color: #e7eff7">
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
        <Services>
            <asp:ServiceReference Path="~/WebService/WebService.asmx" InlineScript="false" />
        </Services>
    </asp:ScriptManager>
    <div id="Div1" style="width: 100%">
        <table border="0" width="100%">
            <tr>
                <td class="th" style="width: 13%">
                    日期:
                    <%=dtNow %>
                </td>
                <td class="th" style="width: 17%" align="left">
                    &nbsp;
                </td>
                <td class="th" style="width: 50%" align="left">
                    &nbsp;
                </td>
                <td class="th" style="width: 20%">
                    安全运行天数 &nbsp;&nbsp;<%=aqts %>
                    天
                </td>
            </tr>
        </table>
    </div>
    <div id="div0" style="min-width: 400px; height:180px;">
        <%--style="width: 100%" --%>
    </div>
    <div id="divs" style="min-width: 400px; height:230px;">
        <%--style="width: 100%" --%>
    </div>
    <div id="Div3" style="height: 5px;">
    </div>
    <table width="100%" border="1" cellpadding="1" cellspacing="0" class="bg">
        <tr bgcolor="#CFE6FC">
            <td class="th">
                机组
            </td>
            <td class="th">
                今日<br>
                发电量
            </td>
            <td class="th">
                昨日<br>
                发电量
            </td>
            <td class="th">
                月累计
            </td>
            <td class="th">
                年累计
            </td>
            <td class="th">
                月计划<br>
                完成率
            </td>
            <td class="th">
                月超时<br />
                间进度
            </td>
            <td class="th">
                年计划<br>
                完成率
            </td>
            <td class="th">
                年超时<br />
                间进度
            </td>
            <td class="th">
                月计划倒<br />排日电量
            </td>
            <tr>
                <td class="th">
                    #1
                </td>
                <td class="th">
                    <label id="lbl1">
                        &nbsp;</label>
                </td>
                <td class="th">
                    <%=fdl1.ToString("f0") %>
                </td>
                <td class="th">
                    <%=yfdl1.ToString("f0") %>
                </td>
                <td class="th">
                    <%=nfdl1.ToString("f0") %>
                </td>
                <td class="th">
                    <%=ywc1 %>
                </td>
                <td class="th">
                    <%=ycw1%>
                </td>
                <td class="th">
                    <%=nwc1 %>
                </td>
                <td class="th">
                    <%=ncw1 %>
                </td>
                <td class="th">
                    <%=jhy.ToString("f0")%>
                </td>
            </tr>
            <tr>
                <td class="th">
                    #2
                </td>
                <td class="th">
                    <label id="lbl2">
                        &nbsp;</label>
                </td>
                <td class="th">
                    <%=fdl2.ToString("f0") %>
                </td>
                <td class="th">
                    <%=yfdl2.ToString("f0") %>
                </td>
                <td class="th">
                    <%=nfdl2.ToString("f0") %>
                </td>
                <td class="th">
                    <%=ywc2 %>
                </td>
                <td class="th">
                    <%=ycw2%>
                </td>
                <td class="th">
                    <%=nwc2 %>
                </td>
                <td class="th">
                    <%=ncw2 %>
                </td>
                <td class="th">
                    年计划倒<br />排日电量
                    
                </td>
            </tr>
            <tr>
                <td class="th">
                    全厂
                </td>
                <td class="th">
                    <label id="qc">
                        &nbsp;</label>
                </td>
                <td class="th">
                    <%=fdl0.ToString("f0") %>
                </td>
                <td class="th">
                    <%=yfdl0.ToString("f0") %>
                </td>
                <td class="th">
                    <%=nfdl0.ToString("f0") %>
                </td>
                <%--  <td class="th">
                    <%=tfdl0.ToString("f2") %>
                </td>--%>
                <td class="th">
                    <%=ywc0%>
                </td>
                <td class="th">
                    <%=ycw0 %>
                </td>
                <td class="th">
                    <%=nwc0 %>
                </td>
                <td class="th">
                    <%=ncw0 %>
                </td>
                <td class="th">
                     <%=jhn.ToString("f0")%>
                </td>
            </tr>
    </table>
    <div id="Div2" style="width: 100%">
        <table border="0" width="100%">
            <tr>
                <td class="th" style="width: 10%" align="right">
                    月度电量计划&nbsp;&nbsp;&nbsp;&nbsp;<%=ydjh %>&nbsp;万Kwh
                </td>
                <td class="th" style="width: 10%" align="left">
                    年度电量计划 &nbsp;&nbsp;&nbsp;&nbsp;<%=ndjh %>&nbsp;万Kwh
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <marquee behavior="scroll" scrollamount="4" onmouseover="this.stop()" onmouseout="this.start()"> <font size="3.5"  color='#000099'>五项重点工作：一是突出安全生产运行，努力争创系统标杆。二是突出经济效益优先，全力实现扭亏为盈。三是突出达标投产重点，着力争创国优工程。四是突出过程精细管理，全面提升管控水平。五是突出维护和谐稳定，推进党建再上台阶。</font></marquee>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
